package regist.listener;

import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.spi.LoggerContextListener;
import ch.qos.logback.core.Context;
import ch.qos.logback.core.spi.ContextAwareBase;
import ch.qos.logback.core.spi.LifeCycle;
import regist.PropertyConfig;

public class CustomLogContextListener extends ContextAwareBase implements LoggerContextListener, LifeCycle {
 
    /** 存储日志路径标识 */
    public static final String LOG_PAHT_KEY = "LOG_PATH";
 
    public boolean isResetResistant() {
        return false;
    }
 

 
 
 
    public void start() {
        // "user.dir"是指用户当前工作目录
        String s = PropertyConfig.getStr("logPath");
        Context context = getContext();
        context.putProperty(LOG_PAHT_KEY,  s);
    }
 
    public void stop() {
 
    }
 
    public boolean isStarted() {
        return false;
    }

	public void onStart(LoggerContext context) {
		// TODO Auto-generated method stub
		
	}

	public void onReset(LoggerContext context) {
		// TODO Auto-generated method stub
		
	}

	public void onStop(LoggerContext context) {
		// TODO Auto-generated method stub
		
	}

	public void onLevelChange(Logger logger, Level level) {
		// TODO Auto-generated method stub
		
	}

}
